import {memberList} from '../../../request/api'

const  state = {
    memberList:[]
} 

const getters = {
    getMemberList(state){
        return state.memberList
    }
}

const mutations = {
    REQ_MEMVERLIST(state,payload){
        state.memberList = payload
    }
}

const actions = {
    changeMemberListActions({commit}){
        memberList().then((res)=>{
            console.log(res,'会员列表');
            if(res.code==200){
                let list = res.list? res.list : [];
                commit('REQ_MEMVERLIST',list)
            }
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    // 命名空间
    namespaced:true
}